//package com.parking.mgr.useraccount.controller;
//
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.parking.mgr.common.annotion.BusinessLog;
//import com.parking.mgr.common.annotion.LoginAuth;
//import com.parking.mgr.common.annotion.PermissionUrl;
//import com.parking.mgr.common.enums.LogAnnotionOpTypeEnum;
//import com.parking.mgr.common.pojo.page.PageResult;
//import com.parking.mgr.common.pojo.response.Result;
//import com.parking.mgr.useraccount.model.param.LoginAuthParam;
//import com.parking.mgr.useraccount.model.vo.LoginAuthVO;
//import com.parking.mgr.useraccount.service.LoginAuthService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import java.util.List;
//
//
///**
// * @ClassName LoginAuthController
// * @Description 登录授权
// * @Auther: zhijianpu
// * @Date: 2023/5/29
// */
//@Api(value = "登录授权", tags = {"登录授权"})
//@RequestMapping("/api/login/auth")
//@RestController
//public class LoginAuthController {
//
//    @Resource
//    private LoginAuthService loginAuthService;
//
//    /**
//     * 登录授权
//     *
//     * @param request
//     * @return
//     */
//    @GetMapping("/getauthcode")
//    @BusinessLog(title = "登录授权获取授权码", opType = LogAnnotionOpTypeEnum.LOGIN)
//    @ApiOperation(value = "登录授权获取授权码", notes = "登录授权获取授权码", httpMethod = "GET")
//    public Result<?> loginAuth(HttpServletRequest request) {
//        return Result.success(loginAuthService.getAuthCode(request));
//    }
//
//    /**
//     * 根据授权码获取用户信息
//     *
//     * @return
//     */
//    @GetMapping("/getlogininfo")
//    @BusinessLog(title = "根据授权码获取用户信息", opType = LogAnnotionOpTypeEnum.LOGIN)
//    @ApiOperation(value = "根据授权码获取用户信息", notes = "根据授权码获取用户信息", httpMethod = "GET")
//    public Result<?> getLoginInfoByAuthCode(
//            @ApiParam(name = "授权码", value = "授权码", required = true)
//            @RequestParam(name = "fCode", required = true)
//            String fCode) {
//        return Result.success(loginAuthService.getLoginUserInfo(fCode));
//    }
//
//    @GetMapping("/list")
//    @ApiOperation(value = "登录授权列表(分页)", notes = "登录授权列表(分页)", httpMethod = "GET")
//    @BusinessLog(title = "登录授权列表(分页)", opType = LogAnnotionOpTypeEnum.PAGE)
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> list(LoginAuthParam loginAuthParam) {
//        IPage<LoginAuthVO> pageList =  loginAuthService.list(loginAuthParam);
//        List<LoginAuthVO> records = pageList.getRecords();
//        PageResult<LoginAuthVO> pageResult = new PageResult<>((Page) pageList);
//        return Result.success(records, pageResult);
//    }
//
//}
